﻿<%@ Page Title="" Language="C#"  AutoEventWireup="true" CodeFile="Gallery.aspx.cs" Inherits="Admin.AdminMasterPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphAdmin" Runat="Server">

<script language="javascript" type="text/javascript">
    function showHideElement(elementId) {
        if (document.getElementById(elementId).style.display == 'none') {
            document.getElementById(elementId).style.display = 'block';
        }
        else {
            document.getElementById(elementId).style.display = 'none';
        }
    }
</script> 
 

   Edit gallery: <asp:DropDownList ID="dropGallery" runat="server" 
        onselectedindexchanged="dropGallery_SelectedIndexChanged" AutoPostBack="True">
    </asp:DropDownList> or create new: 
    <asp:TextBox ID="txtNew" runat="server"></asp:TextBox>
    <asp:Button ID="btnAddNew"
        runat="server" Text="Dodaj" onclick="btnAddNew_Click" />
        
        <p><asp:LinkButton ID="lnkDeleteGallery" 
                OnClientClick="javascript:if(confirm('Are you sure? This operation cannot be undone!'))return true;else return false;" 
                runat="server" onclick="lnkDeleteGallery_Click">delete entire gallery</asp:LinkButton> | <a href="#" onclick="javascript:showHideElement('renameField')">rename gallery</a></p>
                
    <p id="renameField" style="display:none;">
        <asp:TextBox ID="txtRename" runat="server"></asp:TextBox>
        <asp:Button ID="btnRename"
            runat="server" Text="Preimenuj" onclick="btnRename_Click" />
    </p>
    <p>
        &nbsp;<asp:Repeater ID="repGallery" runat="server" 
        onitemcommand="repGallery_ItemCommand">
    <ItemTemplate>
        <div style="display:inline-block;">
            <asp:Image ID="img" runat="server" style="display:inline;" ImageUrl="<%#Container.DataItem %>"  /><br />
            <asp:LinkButton ID="lnkDeleteImg" CommandName="delete" OnClientClick="javascript:if(confirm('Are you sure? This operation cannot be undone!'))return true;else return false;" runat="server">delete</asp:LinkButton>
        </div>
    </ItemTemplate>
    </asp:Repeater>
    <div style="display:inline-block;">
        Add new image:<br />
        <asp:FileUpload ID="uploadImg" runat="server" />
        <asp:Button ID="btnAddNewImg" runat="server" Text="Dodaj" 
            onclick="btnAddNewImg_Click" />
    </div>
        
    </p>
    
</asp:Content>

